package miku.firstgame.net.pack
{
	import flash.utils.ByteArray;

	import miku.firstgame.constrants.ProtocalConstants;
	import miku.firstgame.net.ByteArrayEx;

	public class PingRequestPack extends AbstractRequestPack
	{
		public static var id:int = 0;

		public function PingRequestPack()
		{
			super();
		}

		override public function encode():ByteArray
		{
			var data:ByteArrayEx = new ByteArrayEx();
			data.writeUnsignedInt(8);
			data.writeShort(tag);
			data.writeShort(0);

			data.writeUnsignedInt(id);
			data.position = 0;
			id++;
			return data;
		}

		override public function get tag():int
		{
			return ProtocalConstants.PING;
		}
	}
}
